//=============================================================================
/**
 * @file	location.h
 * @brief	フィールドマップシステム
 * @author	tamada GAME FREAK inc.
 * @date	2005.12.16
 *
 * 2005.12.16	fieldsys.hからLOCATION_WORKの定義を切り離した
 */
//=============================================================================

#ifndef	__LOCATION_H__
#define	__LOCATION_H__

#include "field/field.h"
#include "savedata/savedata_def.h"

//--------------------------------------------------------------
///	LOCATION_WORK構造体
//--------------------------------------------------------------
typedef struct {
	int zone_id;
	int door_id;
	int grid_x;
	int grid_z;
	int dir;
}LOCATION_WORK;

//--------------------------------------------------------------
//--------------------------------------------------------------
#define DOOR_ID_JUMP_CODE	(-1)

//=============================================================================
//=============================================================================
//--------------------------------------------------------------
/**
 * @brief	ゲーム開始時の位置初期化
 */
//--------------------------------------------------------------
extern void LOCATION_GameInit(SAVEDATA * sv);

//--------------------------------------------------------------
/**
 * @brief	ゲーム開始時の位置取得
 */
//--------------------------------------------------------------
extern void LOCATION_SetFirstPos(LOCATION_WORK * location);
//------------------------------------------------------------------
/**
 * @brief	ゲーム開始時の脱出位置取得
 */
//------------------------------------------------------------------
extern void LOCATION_SetFirstEscapePos(LOCATION_WORK * location);

//--------------------------------------------------------------
/**
 * @brief	LOCATION_WORKのセット
 */
//--------------------------------------------------------------
static inline void SetLocation(LOCATION_WORK * loc, int zone, int door, int x, int z, int dir)
{
	loc->zone_id = zone;
	loc->door_id = door;
	loc->grid_x = x;
	loc->grid_z = z;
	loc->dir = dir;
}

#ifdef	PM_DEBUG
//------------------------------------------------------------------
/**
 * @brief	現在位置をデバッグ用初期開始位置にセットする
 */
//------------------------------------------------------------------
extern void LOCATION_GameInit_Debug(SAVEDATA * sv);
#endif


#endif	//__LOCATION_H__